package cn.hy.today;

class Solution_2660 {
    public int isWinner(int[] player1, int[] player2) {
        int a = getScore(player1), b = getScore(player2);
        return a == b ? 0 : a > b ? 1 : 2;
    }


    private int getScore(int[] arr) {
        int ans = 0;
        for (int i = 0; i < arr.length; i++) {
            int k = (i > 0 && arr[i - 1] == 10) || (i > 1 && arr[i - 2] == 10) ? 2 : 1;
            ans += arr[i] * k;
        }
        return ans;
    }
}